package com.example.poidemo.spire;

import com.spire.doc.*;
import com.spire.doc.collections.ParagraphCollection;
import com.spire.doc.documents.*;

import java.util.Iterator;

public class WordParaIndent {
    public static void main(String[] args) {

        //加载文档
        Document document = new Document();
        document.loadFromFile("OutputPDFToWord.docx");

        //获取第一个section
        Section section = document.getSections().get(0);
        ParagraphCollection paragraphs = section.getParagraphs();
        Iterator iterator = paragraphs.iterator();
        while (iterator.hasNext()) {
            Paragraph next = (Paragraph) iterator.next();
            System.out.println("p" + next.getText());
        }
        document.dispose();

    }
}